package com.hhp.cloud.shop.auth.controller;

import com.hhp.cloud.shop.common.core.result.R;
import com.hhp.cloud.shop.common.sms.service.AliyunSmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 短信验证码
 * @author: hhp
 * @date: 2021/11/23 15:34
 */
@Api(tags = "短信验证码")
@RestController
@RequestMapping("/smsCode")
@RequiredArgsConstructor
public class SmsCodeController {

    private final AliyunSmsService aliyunSmsService;

    @ApiOperation(value = "发送短信验证码")
    @ApiImplicitParam(name = "phoneNumber", example = "17621590365", value = "手机号", required = true)
    @PostMapping
    public R sendSmsCode(String phoneNumber)  {
        return aliyunSmsService.sendSmsCode(phoneNumber);
    }
}
